import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
      'comp': path.resolve(__dirname, 'src/components'),
      'style': path.resolve(__dirname, 'src/style'),
      'api': path.resolve(__dirname, 'src/api'),
      'utils': path.resolve(__dirname, 'src/utils'),
      'pages': path.resolve(__dirname, 'src/pages'),
      'routers': path.resolve(__dirname, 'src/routers'),
      'config': path.resolve(__dirname, 'src/config'),
    }
  },
  server: {
    cors: true,
    open: true,
    proxy: {
      '/api': {
          target: 'https://bv.augurit.com/mlxc-applet-api',   //代理接口
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
